package com.ruoyi.web.controller.datastatistics;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.WeChatTableDataInfo;
import com.ruoyi.datastatistics.service.IRealtimegatherdataXbService;
import com.ruoyi.datastatistics.wxentity.WXRealtimegatherdataXb;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 实时数据采集（小）Controller
 * 
 * @author ruoyi
 * @date 2023-09-07
 */
@RestController
@RequestMapping("/api/RealtimeDataStatistic")
public class RealtimegatherdataXbController extends BaseController
{
    @Autowired
    private IRealtimegatherdataXbService realtimegatherdataXbService;

    /**
     * 小表实时数据查询
     */
    @GetMapping("/GetRealtimeGatherDataLastForPage")
    @PreAuthorize("@ss.hasPermi('basedata:terminalxb:list')")
    public WeChatTableDataInfo list(@RequestParam("terminalId") String terminalId,
                                    @RequestParam("beginReadDate") String startTime,
                                    @RequestParam("endReadDate") String endTime)
    {
        PageDomain pageDomain = startWeChatPage();
        List<WXRealtimegatherdataXb> list = realtimegatherdataXbService.selectWXRealtimegatherdataXbList(terminalId,startTime,endTime);
        return getWeChatDataTable(list,pageDomain);
    }


}
